![]() |
ALMaSS
1.0
The Animal, Landscape and Man Simulation System
|
ALMaSS_MathFuncs constructor. More...
#include <Misc.h>
Public Member Functions | |
ALMaSS_MathFuncs () | |
ALMaSS_MathFuncs constructor. More... | |
virtual | ~ALMaSS_MathFuncs () |
ALMaSS_MathFuncs deconstructor. More... | |
int | CalcDistPythagoras (int a_x, int a_y, int a_x1, int a_y1) |
Calculate distance using Pythagoras. More... | |
int | CalcDistPythagorasApprox (int a_x, int a_y, int a_x1, int a_y1) |
Calculate distance using the Pythagoras approximation. More... | |
ALMaSS_MathFuncs constructor.
|
inline |
ALMaSS_MathFuncs constructor.
This class is designed to hold general math functions frequently used in the ALMaSS code. For example distance calculations using either Pythagoras or the approximation of Pythagoras
|
inlinevirtual |
int ALMaSS_MathFuncs::CalcDistPythagoras | ( | int | a_x, |
int | a_y, | ||
int | a_x1, | ||
int | a_y1 | ||
) |
Calculate distance using Pythagoras.
Referenced by Goose_Base::EvaluateForageToHopLoc(), Goose_Population_Manager::FindClosestRoost(), Goose_Population_Manager::GetDistToClosestRoost(), and Goose_Population_Manager::GetForageLocIndex().
int ALMaSS_MathFuncs::CalcDistPythagorasApprox | ( | int | a_x, |
int | a_y, | ||
int | a_x1, | ||
int | a_y1 | ||
) |
Calculate distance using the Pythagoras approximation.
The approximation to Pythagorus is accurate to around 6%
Referenced by Goose_Population_Manager::BangAtPoly(), GooseMemoryMap::ChangeSetFoodRes(), GooseMemoryMap::DecayAllMemory(), Goose_Base::EvaluateForageToHopLoc(), Goose_Base::FlyTo(), Goose_Base::On_Bang(), and Goose_Base::st_ChooseForageLocation().